﻿using System;
using System.Windows.Forms;
using Peepster.Core;
using Peepster.Properties;

namespace Peepster
{
    internal static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        private static void Main()
        {
            Application.EnableVisualStyles();
            Application.ApplicationExit += ApplicationApplicationExit;
            Application.SetCompatibleTextRenderingDefault(false);

            //var result = new SettingsView().ShowDialog();
            if (String.IsNullOrEmpty(AppSettings.TwitterUserName))
                if (new SettingsView().ShowDialog() == DialogResult.Cancel) return;

            var inputView = new InputView() {Visible = false};
            Application.Run(inputView);
        }

        private static void ApplicationApplicationExit(object sender, EventArgs e)
        {
            Settings.Default.Save();
        }
    }
}